<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="{:U('Ballbar/index')}">球帖列表</a></li>
     <li class="active"><a >查看评论</a></li>
  </ul>
  <div class="common-form">
    <div class="table_list">
      <div class="p10"><div class="pages"> {$Page} </div> </div>
   <table width="100%" cellspacing="0" class="table table-hover">
        <thead>
          <tr>
            <th width="50">ID</th>
            <th width="150">主帖名称</th>
            <th>评论内容</th>
            <th>屏蔽</th>
            <th width="200">ID：用户昵称</th>
            <th width="70">点赞量</th>
            <th width="120">发布时间</th>
          </tr>
        </thead>
        <tbody>
        <foreach name="lists" item="vo">
	        	<tr>
					<td>{$vo.id}</td>
			    <td>{$class.title}</td>
					<td>{$vo.description}</td>
          <td>
					<if condition="$vo['extraDesc'] eq 0">
          	<a href="{:U('ballbar/shield',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要屏蔽评论？">屏蔽</a>
					<else />
          	<a href="{:U('ballbar/restore',array('id'=>$vo['id']))}"class="J_ajax_dialog_btn" data-msg="您确定要取消屏蔽？"style="color: #FF0000;"><b>已屏蔽</b></a>
					</if>
          </td>
					<td>
								用户ID：{$vo.userid}
		        		<foreach name="users" item="user">
		        			<if condition="$vo['userid'] eq $user['id']">
			        			{$user.nickname}
		        			</if>
		            </foreach>
			    </td>
				<td>
				<php>$i=0;</php>
		        		<foreach name="favorites" item="favorite">
		        			<if condition="$favorite['relatedid'] eq $vo['id']">
			        			<php>$i++;</php>
		        			</if>
		                </foreach>
		                <a href="{:U('ballbar/attention',array('id'=>$vo['id']))}">点赞（{$i}）</a>
            	</td>
					<td>{$vo.created}</td>
				</tr>
	        <foreach name="replys" item="reply">
			    <if condition="$reply['parentid'] eq $vo['id']">
	        	<tr>
					<td>{$reply.id}</td>
					<td>──回复：
			        		<foreach name="users" item="user">
			        			<if condition="$vo['userid'] eq $user['id']">
				        			{$user.nickname}<br> 
			        			</if>
			                </foreach>
			               UserID: ({$vo.userid})
					</td>
					<td>{$reply.description}</td>
					<td>
			        		<foreach name="users" item="use">
			        			<if condition="$reply['userid'] eq $use['id']">
				        			{$use.nickname}<br> 
			        			</if>
			                </foreach>
			                UserID: ({$reply.userid})
			        </td>
				<td>
				<php>$j=0;</php>
		        		<foreach name="favorites" item="favorite">
		        			<if condition="$favorite['relatedid'] eq $reply['id']">
			        			<php>$j++;</php>
		        			</if>
		                </foreach>
		                {$j}<br>
		                <a href="{:U('ballbar/attention',array('id'=>$reply['id']))}">查看点赞</a>
            	</td>
					<td>{$reply.created}</td>
				</tr>
			    </if>
	        </foreach>
        </foreach>
        </tbody>
        <thead>
          <tr>
            <th width="50">ID</th>
            <th width="150">主帖名称</th>
            <th>评论内容</th>
            <th>屏蔽</th>
            <th width="200">ID：用户昵称</th>
            <th width="70">点赞量</th>
            <th width="120">发布时间</th>
          </tr>
        </thead>
      </table>
      <div class="p10"><div class="pages"> {$Page} </div> </div>
    </div>
      <div class="form-actions">
        <button type="button" class="btn" onclick="javascript:history.go(-1);">返回</button>
      </div>
  </div>
</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
</body>
</html>
